Skip to content

Conversation

Bhavishya2912
Copy link

@Bhavishya2912 Bhavishya2912 commented Oct 12, 2025

Bug Fix : This PR fixes a bug in rtl_ltr_linter.py where the script incorrectly processes <div> tags.

The Bug:
The lint_file function uses continue statements after detecting an opening or closing <div> tag. This causes the linter to stop processing the rest of the line, which leads to a problem if a single line contains both an opening and a closing tag, like <div dir="rtl">Some Text</div>.

This bug can make the block_context_stack inconsistent, which may result in incorrect linting of subsequent lines and lead to false positives.

The Fix:
I have refactored the code to handle all <div> tags on a single line. Instead of using continue statements, the script now finds all <div> tags on a line and processes them in order, ensuring the block_context_stack remains accurate. This fix is a minor change that improves the linter's reliability without affecting its core functionality.

@MohitMehtre
Copy link

Closes #12430

@eshellman
Copy link
Collaborator

@gabriele-ciccotelli ?

@eshellman eshellman added the 👀 Needs Review Is this really a good resource? Reviews requested. label Oct 13, 2025
@Ajay-singh1 Ajay-singh1 requested a review from Thenlie October 13, 2025 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👀 Needs Review Is this really a good resource? Reviews requested.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants